import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { ProxyMiddleware } from './middleware/proxy';
import { ProxyController } from './controllers/proxy';

@Module({
  imports: [],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(ProxyMiddleware)
      .forRoutes({ path: "proxy/*", method: RequestMethod.GET });
  }
}
